package com.tianjin.design.memento;

public class GameRole {

	private int blood;
	private int exp;

	public void kill() {
		this.blood = 0;
		this.exp = 0;
	}

	/**
	 *
	 * @return
	 * 2023年6月12日
	 * chaiz tianjin
	 * TODO 创建当前对象某个时刻的备忘录对象
	 */
	public GameRoleMemento createMemento() {
		return new GameRoleMemento(this.blood, this.exp);
	}

	public void resetGameRole(GameRoleMemento memento) {
		this.blood = memento.getBlood();
		this.exp = memento.getExp();
	}


	public GameRole() {}

	public GameRole(int blood, int exp) {
		super();
		this.blood = blood;
		this.exp = exp;
	}
	public int getBlood() {
		return blood;
	}
	public void setBlood(int blood) {
		this.blood = blood;
	}
	public int getExp() {
		return exp;
	}
	public void setExp(int exp) {
		this.exp = exp;
	}


	@Override
	public String toString() {
		return "GameRole [blood=" + blood + ", exp=" + exp + "]";
	}


}
